<!--Denna versionen skapar bara ett rutnät,-->
<!--Kvar att göra, lägga in bakgrundsbild
lägga in mouse over:
göra till funktion-->

<?php
include '../phpFunctions/getSinglePictureUrl.php';
?>
<html>

    <head>
        <link href="../ImageResize/grid_style.css" media="screen" rel="stylesheet" type="text/css">


    </head>
<center>



    <div id="page">
     <div id="grid-container"><div class="grid" >
      <?php
     $top = 0;
     $left = 0;
     $marginLeft = 0;
     $marginTop = 0;
     $picIndex = 1;
     $squaresPerRow = 8;
     $numberOfSquares = 45;
     include '../phpFunctions/databaseConnect.php';
     $result = mysql_query("select pictureURL from items");
     $numRows= mysql_num_rows($result);

        while($picIndex<$numberOfSquares) {


            $picURL = getSinglePictureUrl($picIndex);

            if ($marginLeft > $squaresPerRow) {$top = $top+100;
                                              ++$marginTop;
                                              $left = 0;
                                              $marginLeft=0;
                                              }

  
            
                    

            print "<a class href = '../index.php'><div class='cell' style='top:$top";
            print "px; left: $left";
            print "px; margin-left: $marginLeft";
            print "px; margin-top: $marginTop";
            print "px;";

            

            print "background-image: url(../Bildgalleri/Paintings/$picURL";


            print")'></div></a>";



            ++$picIndex;
            ++$marginLeft;
            $left = $left +100;
            
       }

//       mysql_close();
      ?>
      </div>
      </div>
      </div>
</center>
</html>
